package com.example.helloandroid;

import android.os.CountDownTimer;
import android.widget.Button;
import android.widget.TextView;

public class myCountDownTimer extends CountDownTimer {

	private TextView tv;
	private TextView tv2;
	private Button button;
	
	public myCountDownTimer(long millisInFuture, long countDownInterval, TextView tv, Button button, TextView tv2){
		super(millisInFuture, countDownInterval);
		this.tv = tv;
		this.tv2 = tv2;
		this.button = button;
	}
	
	public void onTick(long millisUntilFinished) {
        tv.setText(""+millisUntilFinished / 1000);
    }

    public void onFinish() {
        tv.setText("Time out!");
        button.setClickable(false);
        tv2.setText("Vous avez perdu !");
    }
   
}
